package com.qf.springmvc.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.qf.springmvc.util.MyDoubleSerializer;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;


@Data

@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class User {

    private Integer id;
    private String name;
    @JsonIgnore
    private Integer age;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy.MM.dd HH:mm:ss",timezone = "GMT+8")
    private Date birthday;
    @JsonSerialize(using = MyDoubleSerializer.class)
    private Double salary;
}
